
package com.shop.cloud.mall.api.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shop.cloud.common.core.constant.CacheConstants;
import com.shop.cloud.mall.common.entity.BalanceConfig;
import com.shop.cloud.mall.api.mapper.BalanceConfigMapper;
import com.shop.cloud.mall.api.service.BalanceConfigService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * 余额功能配置
 *
 * @author
 * @date 2023-11-01 10:38:47
 */
@Service
public class BalanceConfigServiceImpl extends ServiceImpl<BalanceConfigMapper, BalanceConfig> implements BalanceConfigService {

    @Override
    @Cacheable(value = CacheConstants.MALL_BALANCE_CONFIG_CACHE, key = "'value'")
    public BalanceConfig getByTenantId(Serializable tenantId) {
        return baseMapper.selectOne(Wrappers.emptyWrapper());
    }
}
